<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/10
 * Time: 16:54
 */
namespace app\admin\validate;

use think\Validate;

class Smscfg extends Validate{
    protected $rule = [
        'client_id'             => 'require',
        'ext_code'              => 'require|max:10',
        'bound_ip'              => 'require',
        'limit_day'             => 'number',
        'limit_month'           => 'number',
        'need_callback'         => 'in:1,0',
        'report_callback_url'   => 'url',
        'mo_callback_url'       => 'url',
        'balance'               => 'number',
        'alert_balance'         => 'number',
        'status'                => 'in:1,0',
    ];
    protected $message  =   [
        'client_id.require'         => '客户ID不能为空',
        'ext_code.require'          => '扩展码不能为空',
        'bound_ip.require'          => 'IP不能为空',
        'ext_code.max'              => '扩展码不能超过10个字符',
        'limit_day.number'          => 'limit_day不是数字',
        'limit_month.number'        => 'limit_month不是数字',
        'balance.number'            => '余额不是数字',
        'alert_balance.number'      => '告警余额不是数字',
        'report_callback_url.url'   => '报告回调地址不正确',
        'mo_callback_url.url'       => '上行回调地址不正确',
        'status.in'                 => '状态不正确',
        'need_callback.in'          => '是否回调不正确',
    ];
}